"""muggle URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from blog.views import *
from blog.api import *
from rest_framework.authtoken import views
from django.contrib.auth.views import logout
from django.conf.urls import include


urlpatterns = [
	url(r'^$', home),
    url(r'^admin/', admin.site.urls),
    url(r'^answer/', answer, name="answer"),
    url(r'^detail/(?P<id>\d+)/$', detail, name="detail"),
    url(r'^home/$', home, name="home"),
    url(r'^login/', Login, name="Login"),
    url(r'^profile/(?P<id>\d+)/$', profile, name="profile"),
    url(r'^register/', register, name="register"),
    url(r'^search/', search, name="search"),
    url(r'^forget-password/', forget_password, name="forget_password"),
    url(r'^logout/', logout, {'next_page':'/login'} ,name="logout"),


    url(r'^api/test/(?P<id>\d+)/$', test_api),
    url(r'^api/token-auths$', views.obtain_auth_token),
    url(r'^api/home_api/(?P<number>\d+)$', home_api, name="home_api"),
    url(r'^api/detail_question_api/(?P<id>\d+)/$', detail_question_api, name='detail_question_api'),
    url(r'^api/detail_answer_api/(?P<id>\d+)/$', detail_answer_api, name='detail_answer_api'),
    url(r'^api/comment/(?P<id>\d+)/$', comment_api, name='comment_api'),
    url(r'^api/new_comment_api', new_comment_api, name='new_comment_api'),
    url(r'^api/vote/', vote, name='vote'),
    url(r'^api/addanswer/', add_answer, name='add_answer'),
    url(r'^api/addquestion/', add_question, name='add_question'),
    url(r'^api/deleanswer/(?P<id>\d+)/$', delete_answer, name='delete_answer'),
    url(r'^api/send_email/', send_captcha_email, name='send_captcha_email'),

]


